package edu.cmu.cs211.bacon.tests;

import static org.junit.Assert.*;

import org.junit.Test;

import edu.cmu.cs211.bacon.util.Edge;
import edu.cmu.cs211.bacon.util.GeneralGraph;
import edu.cmu.cs211.bacon.util.Kruskal;


public class KruskalTest {
	@Test
	public void simple()
	{
		GeneralGraph<String, Edge<String>> g = new GeneralGraph<String, Edge<String>>();
		g.addVertex("s");
		g.addVertex("a");
		g.addVertex("b");
		g.addVertex("c");
		g.addVertex("d");
		
		g.addEdge(new Edge<String>("s", "c", 4));
		g.addEdge(new Edge<String>("s", "b", 2));
		g.addEdge(new Edge<String>("s", "a", 5));

		
		Kruskal kk = new Kruskal();
		assertEquals("there should be no MST",kk.spanningTree(g),null);
		g.addEdge(new Edge<String>("d", "a", 1));
		
		assertEquals("there should be MST",kk.spanningTree(g) == null,false);
	}
}
